#include <iostream>
#include "network/vsocket.h"
#include "network/connections.h"
#include <string>

int main(int argc, char **argv)
{
/*
    connection_sever <linux_connection_server, vsock_t> s(54555);

    vsock_t sock;
    if (!s.init()) std::cout << "init fail" << std::endl;
    if (!s.get_connection(sock)) std::cout << "connect fail" << std::endl;
    sock.send_numeric(777);
*/

    vsock_t sock;
    connection_client<linux_connection_client, vsock_t> s2(54555, std::string("127.0.0.1"));
    if (!s2.init()) std::cout << "init fail" << std::endl;
    if (!s2.connect(sock)) std::cout << "connect fail" << std::endl;
    std::cout << sock.recv_numeric<int>() << std::endl;
    return 0;
}
